package com.p2p.controller.loanManagement;

import com.p2p.common.R;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/shelf")
@Api (value = "上架信息API",tags = "借贷管理的上架信息API")
public class ShelfController {

    /**
     * 分页显示所有上架信息
     * @param currentPage 当前页码数默认第一页
     * @param pageSize 每页显示记录数
     * @return R
     */
    @ApiOperation(value = "分页显示所有上架信息",notes = "分页显示所有上架信息",
            httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数默认第一页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示记录数",paramType = "query",dataType = "String",required = true)
    })
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @GetMapping(value = "/findShelfList")
    @ResponseBody
    public R findShelfList(Integer currentPage,Integer pageSize ){

        return null;
    }

    /**
     * 添加上架信息
     * @return R
     */
    @ApiOperation(value = "添加上架信息",notes = "添加上架信息",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @PostMapping("/addShelf")
    @ResponseBody
    public R addShelf(){
        return null;
    }
    /**
     * 修改上架信息
     * @return R
     */
    @ApiOperation(value = "修改上架信息",notes = "修改上架信息",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @PostMapping("/updateShelf")
    @ResponseBody
    public R updateShelf(){
        return null;
    }


    /**
     * 删除上架信息
     * @return R
     */
    @ApiOperation(value = "删除上架信息",notes = "删除上架信息",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @PostMapping("/deleteShelf")
    @ResponseBody
    public R deleteShelf(){
        return null;
    }

    /**
     * 根据id查询上架信息
     * @return R
     */
    @ApiOperation(value = "根据id查询上架信息",notes = "根据id查询上架信息",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @GetMapping("/findShelfById")
    @ResponseBody
    public R findShelfById(){
        return null;
    }
    /**
     * 根据condition查询上架信息
     * @param currentPage 当前页码数默认第一页
     * @param pageSize 每页显示记录数
     * @param condition
     * @return R
     */
    @ApiOperation(value = "根据condition查询上架信息",notes = "根据condition查询上架信息",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数默认第一页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示记录数",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "condition",value = "查询条件",paramType = "query",dataType = "String",required = true)
    })
    @ApiResponses({
            @ApiResponse(code=200,message="成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @GetMapping("/findShelfByCondition")
    @ResponseBody
    public R findShelfByCondition(Integer currentPage,Integer pageSize,String condition){
        return null;
    }

}
